package com.googlecode.guicespring;

import javax.servlet.http.HttpServletRequest;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.OpenSessionInViewFilter;

import com.google.inject.Inject;

public class GuiceOpenSessionInViewFilter extends OpenSessionInViewFilter {

	private SessionFactory sessionFactory;
	
	@Inject
	public GuiceOpenSessionInViewFilter(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	protected SessionFactory lookupSessionFactory(HttpServletRequest request) {
		return sessionFactory;
	}
	
}
